package com.zzy.msg;

import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.stereotype.Component;

/**
 * 接收消息
 * */
@Component
public class RedisMessageListener implements MessageListener {
    @Override
    public void onMessage(Message message, byte[] pattern) {
        System.out.println("Received message: " +
                new String(message.getBody()) +
                " from channel: " +
                new String(message.getChannel()));
    }
}

